﻿@model zichan.Models.OldPutAwayCode
@{
    ViewBag.Title = "part_Code";
}
<link rel="stylesheet" type="text/css" href="/assets/global/plugins/select2/select2.css" />
<link href="/assets/global/css/plugins.css" rel="stylesheet" type="text/css" />
<label class="col-md-3 control-label xh">服务器编码:</label>
<div class="col-md-9">
    @Html.DropDownList("ServerId", (SelectList)ViewBag.Codes, new { @class = "form-control input-large", @placeholder = "请先出库相应的服务器" })
    <span class="help-block">
        @Html.ValidationMessageFor(o => o.ServerId)
    </span>
</div>
<script type="text/javascript" src="/assets/global/plugins/select2/select2.min.js"></script>
<script src="~/assets/global/plugins/select2/select2_locale_zh-CN.js"></script>
<script type="text/javascript">
    $(function () {
        $('#ServerId').select2({
            placeholder: "选择服务器编码",
            allowClear: false
        });
        if ($("#ServerId").val() != null) {
            var code = $("#ServerId").val();
            $("#use_NO").load("/Common/oldpart_useNO?assetId=" + code);
        }
        $("#ServerId").on("change", function () {
            if ($(this).val() != "") {
                var code = $(this).val();
                $("#use_NO").load("/Common/oldpart_useNO?assetId=" + code);
            }
        });
    })
</script>